<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动态绑定外部样式类——数据语法</title>
    <style>
        .active {
            background-color: chocolate;
        }

        .line {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div id="app">
    <h1 v-bind:class="classObject1">Hello, Vue!</h1>
    <h1 v-bind:class="classObject2">Hello, Vue!</h1>
</div>

<script type="module">
    import {createApp, ref, reactive} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                // 数据对象
                let classObject1  = reactive({
                    active: true,
                    line:false,
                })

                let classObject2  = reactive({
                    active: false,
                    line:true,
                })

                return {
                    classObject1,
                    classObject2,

                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>